<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../../ohter/js库/mock.js"></script>
    <script src="../../ohter/js库/vue.js"></script>
    <title>css溢出文字省略显示</title>
    <style>
        
        /*
        单行文本溢出省略号显示 
            必须满足三个条件
                必须强制文字一行显示 white-space: nowrap;
                超出部分隐藏 overflow: hidden;
                用省略号代替超出部分  overflow: hidden;
        多行文本溢出省略号显示  有兼容性问题
         */
        li {
            width: 100px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        div.duo {
            width: 200px;
            height: 50px;
            background-color: pink;
        }
    </style>

</head>

<body>
    <div id="root">
            <div class="duo">
                {{duo}}
            </div>
            <ul>
                <li v-for="word in wordlist "> {{word}}</li>
            </ul>
    </div>
</body>
<script>
    new Vue({
        el: '#root',
        data() {
            return {
                duo:Mock.mock('@cword(50)'),
                wordlist :[
                  Mock.mock('@cword(50)'),
                  Mock.mock('@cword(50)'),
                  Mock.mock('@cword(50)'),
                  Mock.mock('@cword(50)'),
                  Mock.mock('@cword(50)'),
                 
                ]
            }
        },
    })
</script>

</html>